<script setup lang="ts">
//  接口 定义对象 通常首字母大写
interface Person {
  name:string
  age:number|string
  readonly id:number
  job?:string
}
interface Student extends Person {
  major:string
}
let p1:Person = {
  name:"lin",
  age:18,
  id:3
}
let p2:Person = {
  name:"大曾",
  age:"28岁",
  id:4,
  job:"teacher"
}
// p1.gender = 0
// p1.age = 30;
// p1.id = 15
let  p3:Student = {
  name:"zql",
  age:22,
  id:4,
  job:"student",
  major:"人工智能"
}
</script>

<template>
  <main>
   <h1>TypeScript学习</h1>
   <p>{{ p1 }}</p>
   <p>{{ p2 }}</p>
   <p>{{ p3 }}</p>
    
   
    
  </main> 
</template>

